home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Celestin Apprentice 4
/
Apprentice-Release4.iso
/
Languages
/
Mops 2.7
/
Mops source
/
Toolbox classes
/
teRecord
< prev
next >
Wrap
Text File
|
1995-12-10
|
1KB
|
87 lines
\ 15May93 DBH Deleted CalcVScrollValue: and CalcHScrollValue: because
\ they are not used here.
:class teRecord super{ object }
record
{ rect destRect
rect viewRect
rect selRect
int lineHeight
int fontAscent
point selPoint
int selStart
int selEnd
int active
ptr wordBreak
ptr clikLoop
12 bytes 1terec \ unmapped
int just
int teLength
handle htext
6 bytes 2terec \ unmapped
int crOnly
int txFont
int txFace
int txMode
int txSize
ptr inPort \ the wptr
8 bytes 3terec \ unmapped
int nlines
0 bytes lineStarts
}
:m lineHeight: ( -- n )
get: lineHeight ;m
:m #lines: ( -- n )
get: nlines ;m
:m selStart: ( -- n )
get: selStart ;m
:m selEnd: ( -- n )
get: selEnd ;m
:m getselect: ( -- addr len ) \ returns hilited selection
ptr: htext selstart: self + ( addr)
selend: self selstart: self - ( len) ;m
:m addrLineStart: ( -- addr)
addr: lineStarts ;m
:m size: ( -- n )
get: teLength ;m
:m setview: ( l t r b -- )
put: viewRect ;m
:m setdest: ( l t r b -- )
put: destRect ;m
:m setrects: { l t r b -- } \ sets both the view and destination rects
l t r b setdest: self
l t r b setview: self ;m
:m @font: ( -- font# )
get: txFont ;m
:m font: ( font# -- )
put: txFont ;m
:m @fontsize: ( -- fontsize )
get: txSize ;m
:m fontsize: ( fontsize -- )
put: txSize ;m
:m gettextaddr: ( -- addr )
get: htext @ ;m
:m WrapIt:
1 put: crOnly ;m \ Nov95 JRF Positive value enables wrap
:m noWrap:
-1 put: crOnly ;m
;class